package com.example.bugshaker.email;

import com.example.mybugshaker.flow.email.Device;
import ohos.agp.window.service.Display;
import ohos.agp.window.service.DisplayAttributes;
import ohos.agp.window.service.DisplayManager;
import ohos.system.DeviceInfo;
import org.junit.Test;

import java.util.Optional;

import static org.junit.Assert.*;

public class DeviceTest {

    Device device = new Device(AppTest.mContext);

    Optional<Display> display = DisplayManager.getInstance().getDefaultDisplay(AppTest.mContext);
    DisplayAttributes displayAttributes = display.get().getAttributes();
    String resolution = displayAttributes.yDpi + "x" + displayAttributes.xDpi;
    String actualDensity = displayAttributes.densityDpi + "dpi";

    @Test
    public void getManufacturer() {
        assertEquals(DeviceInfo.getName(), device.getManufacturer());
    }

    @Test
    public void getModel() {
        assertEquals(DeviceInfo.getModel(), device.getManufacturer());
    }

    @Test
    public void getResolution() {
        assertEquals(resolution, device.getResolution());
    }

    @Test
    public void getActualDensity() {
        assertEquals(actualDensity, device.getActualDensity());
    }
}